#include "Component.h"
namespace CompositeMode
{
    class Leaf:public Component
    {
    public:
        Leaf(std::string name):_name(name)
        {

        }

        virtual void add(Component* c) 
        {

        }

        virtual void remove(Component* c) 
        {

        }

        virtual Component* getChild(int i) 
        {
            return nullptr;
        }

        virtual void operation() 
        {
            std::cout<<"树叶"<<_name<<"被访问"<<std::endl;
        }     

    private:
        std::string _name;
    };
}